package IMIC.NGUYENVANTINH.ARRAY.EXCERCISE.EX04;

public class Views {
	public static void main(String[] args) {
		int[] myarr = { 1, 2, 4, 5, 10, 100, 2, -22, 100, 99, 80, 5 };
		// In ra mang vua nhap.
		System.out.println("Mang vua nhap la...");
		Print(myarr);
		// Khoi tao controllers
		Controllers ctrl = new Controllers();
		// uy quyen cho controllers thuc thi nhiem vu.
		// Find max number of array
		int max = ctrl.FindMaxNumBer(myarr);
		System.out.println("Number max of array " + max);
		//In ra chi so chua phan tu max
		int[] IndexMax = ctrl.IndexMaxOfArr(myarr, max);
		System.out.println("Index max of number array.");
		Print(IndexMax);
		// Find min
		int min = ctrl.FindMinNumBer(myarr);
		System.out.println("Number min of array " + min);
		//In ra chi so chua phan tu max
		int[] IndexMin = ctrl.IndexMaxOfArr(myarr, min);
		System.out.println("Index min of number array.");
		Print(IndexMin);
		// Find min
		
	}

	static void Print(int[] myarr) {
		for (int i = 0; i < myarr.length; i++) {
			System.out.print(myarr[i] + " ");
		}
		System.out.println();
	}

}
